package com.bsoft.gol.hcs.specialist.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * @Author:FangZhiyi
 * @Description
 * @Data Created in 2020/10/13 10:45
 * @Moddified By:
 */
@Entity
@Table(name = "easemob_chatmessages", schema = "", catalog = "")
public class EasemobChatmessages implements Serializable {
    private String msgId;
    private long msgTimestamp;
    private String fromUserName;
    private String toUserName;
    private String chatType;
    private String direction;
    private String payload;

    @Id
    @Column(name = "msg_id")
    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    @Basic
    @Column(name = "msg_timestamp")
    public long getMsgTimestamp() {
        return msgTimestamp;
    }

    public void setMsgTimestamp(long msgTimestamp) {
        this.msgTimestamp = msgTimestamp;
    }

    @Basic
    @Column(name = "from_user_name")
    public String getFromUserName() {
        return fromUserName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    @Basic
    @Column(name = "to_user_name")
    public String getToUserName() {
        return toUserName;
    }

    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }

    @Basic
    @Column(name = "chat_type")
    public String getChatType() {
        return chatType;
    }

    public void setChatType(String chatType) {
        this.chatType = chatType;
    }

    @Basic
    @Column(name = "direction")
    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    @Basic
    @Column(name = "payload")
    public String getPayload() {
        return payload;
    }

    public void setPayload(String payload) {
        this.payload = payload;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        EasemobChatmessages that = (EasemobChatmessages) o;
        return msgTimestamp == that.msgTimestamp &&
                Objects.equals(msgId, that.msgId) &&
                Objects.equals(fromUserName, that.fromUserName) &&
                Objects.equals(toUserName, that.toUserName) &&
                Objects.equals(chatType, that.chatType) &&
                Objects.equals(direction, that.direction) &&
                Objects.equals(payload, that.payload);
    }

    @Override
    public int hashCode() {
        return Objects.hash(msgId, msgTimestamp, fromUserName, toUserName, chatType, direction, payload);
    }
}
